
using System.Data.Entity.ModelConfiguration;

namespace OBUCare.Core.Models.Mapping
{
    public class INVOICE_INFOMap : EntityTypeConfiguration<INVOICE_INFO>
    {
        public INVOICE_INFOMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.INVOICE_NO)
                .HasMaxLength(50);

            this.Property(t => t.USER_NO)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(16);

            this.Property(t => t.OPERATOR_NO)
                .IsRequired()
                .HasMaxLength(6);

            this.Property(t => t.AGENT_NO)
                .IsRequired()
                .HasMaxLength(12);

            this.Property(t => t.REMARK)
                .HasMaxLength(500);

            // Table & Column Mappings
            this.ToTable("INVOICE_INFO");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.INVOICE_NO).HasColumnName("INVOICE_NO");
            this.Property(t => t.STATUS).HasColumnName("STATUS");
            this.Property(t => t.INVOICE_TYPE).HasColumnName("INVOICE_TYPE");
            this.Property(t => t.AMOUNT).HasColumnName("AMOUNT");
            this.Property(t => t.USER_NO).HasColumnName("USER_NO");
            this.Property(t => t.INCOICE_TIME).HasColumnName("INCOICE_TIME");
            this.Property(t => t.OPERATOR_NO).HasColumnName("OPERATOR_NO");
            this.Property(t => t.AGENT_NO).HasColumnName("AGENT_NO");
            this.Property(t => t.REMARK).HasColumnName("REMARK");
        }
    }
}
